cmake_minimum_required(VERSION 2.8)
project(udp-obfuscator CXX)

include(config.cmake)

if (WIN32 OR APPLE)
	set(Boost_USE_STATIC_LIBS ON)
endif ()
find_package(Boost REQUIRED system)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

add_executable(udpobfuscator src/udp_forward.h src/udp_forward.cpp src/udp_obfuscator.cpp)
target_link_libraries(udpobfuscator ${Boost_LIBRARIES})
if (UNIX)
   target_link_libraries(udpobfuscator pthread)
   set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
   set(MY_LINK_FLAGS "-std=c++0x")
   if (APPLE)
      set(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
      set(MY_LINK_FLAGS "-stdlib=libc++ ${MY_LINK_FLAGS}")
   endif ()
   set_target_properties(udpobfuscator PROPERTIES LINK_FLAGS ${MY_LINK_FLAGS})
elseif (WIN32)
	add_definitions(-D_WIN32_WINNT=_WIN32_WINNT_WINXP)
endif ()
